local tongjue = fk.CreateSkill {
  name = "tongjue$",
}

tongjue:addEffect("active", {
  anim_type = "support",
  card_num = 0,
  target_num = 0,
  prompt = "#tongjue-invoke",
  can_use = function(self, player)
    return player:usedSkillTimes(self.name, Player.HistoryPhase) == 0 and not player:isKongcheng() and
      table.find(Fk:currentRoom().alive_players, function(p) return p ~= player and p.kingdom == "qun" end)
  end,
  card_filter = Util.FalseFunc,
  target_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local list = room:askForYiji(
      player,
      player:getCardIds(Player.Hand),
      table.filter(
        room.alive_players,
        function(p)
          return
            p ~= player and
            p.kingdom == "qun"
        end
      ),
      self.name,
      1,
      999,
      "#tongjue-invoke",
      nil,
      false,
      1
    )
    if player.dead then return end
    local mark = player:getTableMark("tongjue-turn")
    for key, value in pairs(list) do
      if #value > 0 then
        table.insert(mark, key)
      end
    end
    room:setPlayerMark(player, "tongjue-turn", mark)
  end,
})
tongjue:addEffect("prohibit", {
  is_prohibited = function(self, from, to, card)
    if from and card then
      return table.contains(from:getTableMark("tongjue-turn"), to.id)
    end
  end,
})
return tongjue